#ifndef UDP_MESSAGE_CONTEXT_H
#define UDP_MESSAGE_CONTEXT_H
#include "message_context.h"
#include "socket_address.h"
#include <string>
namespace vpm
{
	namespace mina
	{
		struct UdpMessageContext : public MessageContext
		{

			UdpMessageContext(char *buf,int len,int p,const std::string & h):buffer(buf),length(len),port(p)
			{
				ip = SocketAddress::atoh(h);
			}

			std::string get_host_addr() const 
			{
				return SocketAddress::htoa(ip);
			}

			void set_host_addr(const std::string & h)
			{
				ip = SocketAddress::atoh(h);
			}

			char * buffer; 
			int length; 
			int port ; 
			unsigned long ip;
		};
	}
}



#endif // UDP_MESSGE_CONTEXT_H
 


  
